package com.pactera.library.bluetooth.event

import android.bluetooth.BluetoothDevice

/**
 * @author ypk
 * 创建日期：2021/9/13  9:48
 * 描述：
 */
class BleManagerEvent(state: Int, var device: BluetoothDevice? = null) {
    var mConnectionState = DISCONNECT

    init {
        mConnectionState = state
    }

    companion object {
        const val DISCONNECT = 0
        const val CONNECTING = 1
        const val CONNECTED = 2
        const val RECONNECTION = 3 //重连中
    }

    val isConnected: Boolean
        get() = mConnectionState == CONNECTED
    val isConnecting: Boolean
        get() = mConnectionState == CONNECTING

    val isDisconnected: Boolean
        get() = mConnectionState == DISCONNECT

    val isReconnection: Boolean
        get() = mConnectionState == RECONNECTION

}






